package com.hl.web.fore;

import com.hl.pojo.ConsultantLevel;
import com.hl.service.ConsultantLevelService;
import com.hl.util.ResultEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/consultantLevel")
public class ConsultantLevelController {
    @Autowired
    private ConsultantLevelService consultantLevelService;

    @PostMapping("/add")
    public ResultEntity add(@RequestBody ConsultantLevel consultantLevel) {
        consultantLevelService.add(consultantLevel);
        return ResultEntity.ok();
    }
    @GetMapping("/findAll")
    public ResultEntity findAll() {
        return ResultEntity.ok(consultantLevelService.findAll());
    }

    @GetMapping("/del")
    public ResultEntity del(Integer id) {
        consultantLevelService.del(id);
        return ResultEntity.ok();
    }

    @GetMapping("/findById")
    public ResultEntity findById(Integer id) {
        return ResultEntity.ok(consultantLevelService.findById(id));
    }
    @PostMapping("/update")
    public ResultEntity update(@RequestBody ConsultantLevel consultantLevel) {
        consultantLevelService.update(consultantLevel);
        return ResultEntity.ok();
    }


}
